import { Controller, Get, Query } from '@nestjs/common';
import { ApiBearerAuth, ApiOperation, ApiTags } from '@nestjs/swagger';
import { ChatService } from './chat.service';
import { Authorize } from 'src/core/decorators/index.decorator';

@ApiTags('聊天模块')
@ApiBearerAuth()
@Controller('chat')
export class ChatController {
  constructor(private chatService: ChatService) {}

  @Get('list')
  @Authorize()
  @ApiOperation({ summary: '获取聊天列表' })
  async getChatList(@Query() query: { userId: string }) {
    return await this.chatService.find(query.userId);
  }
}
